#include <stdio.h>
#include <bsort.h>
#include <stdlib.h>
#include <time.h>



int main ()
{
	srand(time(NULL));
	size_t size = 10;
	int i_arr[size];
	double d_arr[size];
	unsigned int i;
	printf("==============\n");
	printf("Int sort\n==============\n");
	for(i = 0; i < size; ++i) {
		i_arr[i] = 1 + (int) (size*size * (rand() / (RAND_MAX + 1.0)));
		printf("%3u: %d\n", i, i_arr[i]);
	}
	printf("=======\n");
	bsort_int(i_arr, 0, size);
	for(i = 0; i < size; ++i)
		printf("%3u: %d\n", i, i_arr[i]);
	printf("==============\n");
	printf("Double sort\n==============\n");
	for(i = 0; i < size; ++i) {
		d_arr[i] = 1 + (size*size * (rand() / (RAND_MAX + 1.0)));
		printf("%3u: %f\n", i, d_arr[i]);
	}
	printf("=======\n");
	bsort_double(d_arr, 0, size);
	for(i = 0; i < size; ++i)
		printf("%3u: %f\n", i, d_arr[i]);
	printf("==============\n");

	return 0;
}
